3.1 \(\int \frac {\tan ^4(x)}{a+a \cos (x)} \, dx\)

Optimal. Leaf size=33 \[ \frac {\tan ^3(x)}{3 a}+\frac {\tanh ^{-1}(\sin (x))}{2 a}-\frac {\tan (x) \sec (x)}{2 a} \]

[Out]

1/2*arctanh(sin(x))/a-1/2*sec(x)*tan(x)/a+1/3*tan(x)^3/a

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2706, 2607, 30, 2611, 3770} \[ \frac {\tan ^3(x)}{3 a}+\frac {\tanh ^{-1}(\sin (x))}{2 a}-\frac {\tan (x) \sec (x)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^4/(a + a*Cos[x]),x]

[Out]

ArcTanh[Sin[x]]/(2*a) - (Sec[x]*Tan[x])/(2*a) + Tan[x]^3/(3*a)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2611

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(a*Sec[e
+ f*x])^m*(b*Tan[e + f*x])^(n - 1))/(f*(m + n - 1)), x] - Dist[(b^2*(n - 1))/(m + n - 1), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2706

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\tan ^4(x)}{a+a \cos (x)} \, dx &=-\frac {\int \sec (x) \tan ^2(x) \, dx}{a}+\frac {\int \sec ^2(x) \tan ^2(x) \, dx}{a}\\ &=-\frac {\sec (x) \tan (x)}{2 a}+\frac {\int \sec (x) \, dx}{2 a}+\frac {\operatorname {Subst}\left (\int x^2 \, dx,x,\tan (x)\right )}{a}\\ &=\frac {\tanh ^{-1}(\sin (x))}{2 a}-\frac {\sec (x) \tan (x)}{2 a}+\frac {\tan ^3(x)}{3 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.13, size = 105, normalized size = 3.18 \[ -\frac {\sec ^3(x) \left (2 (-3 \sin (x)+3 \sin (2 x)+\sin (3 x))+9 \cos (x) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right )+3 \cos (3 x) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right )\right )}{24 a} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^4/(a + a*Cos[x]),x]

[Out]

-1/24*(Sec[x]^3*(9*Cos[x]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]]) + 3*Cos[3*x]*(Log[Cos[x/2] - S
in[x/2]] - Log[Cos[x/2] + Sin[x/2]]) + 2*(-3*Sin[x] + 3*Sin[2*x] + Sin[3*x])))/a

________________________________________________________________________________________

fricas [A]  time = 0.79, size = 50, normalized size = 1.52 \[ \frac {3 \, \cos \relax (x)^{3} \log \left (\sin \relax (x) + 1\right ) - 3 \, \cos \relax (x)^{3} \log \left (-\sin \relax (x) + 1\right ) - 2 \, {\left (2 \, \cos \relax (x)^{2} + 3 \, \cos \relax (x) - 2\right )} \sin \relax (x)}{12 \, a \cos \relax (x)^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="fricas")

[Out]

1/12*(3*cos(x)^3*log(sin(x) + 1) - 3*cos(x)^3*log(-sin(x) + 1) - 2*(2*cos(x)^2 + 3*cos(x) - 2)*sin(x))/(a*cos(
x)^3)

________________________________________________________________________________________

giac [B]  time = 0.71, size = 65, normalized size = 1.97 \[ \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{2 \, a} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{2 \, a} - \frac {3 \, \tan \left (\frac {1}{2} \, x\right )^{5} + 8 \, \tan \left (\frac {1}{2} \, x\right )^{3} - 3 \, \tan \left (\frac {1}{2} \, x\right )}{3 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}^{3} a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="giac")

[Out]

1/2*log(abs(tan(1/2*x) + 1))/a - 1/2*log(abs(tan(1/2*x) - 1))/a - 1/3*(3*tan(1/2*x)^5 + 8*tan(1/2*x)^3 - 3*tan
(1/2*x))/((tan(1/2*x)^2 - 1)^3*a)

________________________________________________________________________________________

maple [B]  time = 0.07, size = 103, normalized size = 3.12 \[ -\frac {1}{3 a \left (\tan \left (\frac {x}{2}\right )-1\right )^{3}}-\frac {1}{a \left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}-\frac {1}{2 a \left (\tan \left (\frac {x}{2}\right )-1\right )}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{2 a}-\frac {1}{3 a \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}+\frac {1}{a \left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {1}{2 a \left (\tan \left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{2 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^4/(a+a*cos(x)),x)

[Out]

-1/3/a/(tan(1/2*x)-1)^3-1/a/(tan(1/2*x)-1)^2-1/2/a/(tan(1/2*x)-1)-1/2/a*ln(tan(1/2*x)-1)-1/3/a/(tan(1/2*x)+1)^
3+1/a/(tan(1/2*x)+1)^2-1/2/a/(tan(1/2*x)+1)+1/2/a*ln(tan(1/2*x)+1)

________________________________________________________________________________________

maxima [B]  time = 0.30, size = 115, normalized size = 3.48 \[ -\frac {\frac {3 \, \sin \relax (x)}{\cos \relax (x) + 1} - \frac {8 \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} - \frac {3 \, \sin \relax (x)^{5}}{{\left (\cos \relax (x) + 1\right )}^{5}}}{3 \, {\left (a - \frac {3 \, a \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + \frac {3 \, a \sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}} - \frac {a \sin \relax (x)^{6}}{{\left (\cos \relax (x) + 1\right )}^{6}}\right )}} + \frac {\log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right )}{2 \, a} - \frac {\log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right )}{2 \, a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="maxima")

[Out]

-1/3*(3*sin(x)/(cos(x) + 1) - 8*sin(x)^3/(cos(x) + 1)^3 - 3*sin(x)^5/(cos(x) + 1)^5)/(a - 3*a*sin(x)^2/(cos(x)
 + 1)^2 + 3*a*sin(x)^4/(cos(x) + 1)^4 - a*sin(x)^6/(cos(x) + 1)^6) + 1/2*log(sin(x)/(cos(x) + 1) + 1)/a - 1/2*
log(sin(x)/(cos(x) + 1) - 1)/a

________________________________________________________________________________________

mupad [B]  time = 0.46, size = 46, normalized size = 1.39 \[ \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^5+\frac {8\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{3}-\mathrm {tan}\left (\frac {x}{2}\right )}{a\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^4/(a + a*cos(x)),x)

[Out]

atanh(tan(x/2))/a - ((8*tan(x/2)^3)/3 - tan(x/2) + tan(x/2)^5)/(a*(tan(x/2)^2 - 1)^3)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\tan ^{4}{\relax (x )}}{\cos {\relax (x )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**4/(a+a*cos(x)),x)

[Out]

Integral(tan(x)**4/(cos(x) + 1), x)/a

________________________________________________________________________________________